package com.tencent.sr.iris.basic.saas.service.constant;

/**
 * 团长活动相关缓存key
 */
public class ActivityRedisKeyConstant {


    /**
     * 导师缓存 %s为uid
     */
    public static final String USER_SUPERVISOR_KEY = "ACTIVITY:TASK:USER:SUPERVISOR:KEY:%s";

    /**
     * 用户信息缓存 %s为uid
     */
    public static final String  USER_INFO_KEY = "ACTIVITY:TASK:USER:INFO:KEY:%s";

    /**
     * 批量设置key并设置失效时间数据脚本
     * ARGV列表的最后一个参数为过期时间
     */
    public static final String BATCH_EXPIRE_SET_SCRIPT = "local len = #KEYS\n" +
            "local exSeconds = ARGV[len + 1]\n" +
            "for i, v in ipairs(KEYS) do\n" +
            "   redis.call('SETEX', v, exSeconds, ARGV[i])\n" +
            "end\n" +
            "return true";

}
